home *** CD-ROM | disk | FTP | other *** search
/ Delphi Informant Complete 1995 - 2000 / Delphi Informant Complete 1995 to 2000.iso / Delphi Informant Magazine Complete Works SOURCE CODE 1998.rar / 1998 / May / di9805rl / hhform.pas < prev    next >
Pascal/Delphi Source File  |  1998-02-27  |  2KB  |  70 lines

  1. unit hhform;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Label1: TLabel;
  12.     Button1: TButton;
  13.     Button2: TButton;
  14.     procedure Button1Click(Sender: TObject);
  15.     procedure Button2Click(Sender: TObject);
  16.   private
  17.     { Private declarations }
  18.   public
  19.     { Public declarations }
  20.   end;
  21.  
  22. var
  23.   Form1: TForm1;
  24.  
  25. implementation
  26.  
  27. uses
  28.     HtmlHelp
  29.     ;
  30.  
  31. {$R *.DFM}
  32.  
  33. procedure TForm1.Button1Click(Sender: TObject);
  34. var
  35.    ChmFile : String;
  36.    URL : String;
  37. begin
  38.   ChmFile := extractFilePath(application.exeName) + 'hhcomp.chm';
  39.   ChmFile := ChmFile + '>TP'; // Append HH Window name (defined in the CHM file)
  40.   URL := 'HtmlHelpIntegrationComponents.html';
  41.   HH(handle, PChar(ChmFile), HH_Display_Topic, Longint(PChar(URL)));
  42. end;
  43.  
  44. procedure TForm1.Button2Click(Sender: TObject);
  45. var
  46.    HHP : HH_Popup;
  47.    Msg : String;
  48. begin
  49.    Msg := 'Popup Video';
  50.    with HHP do begin
  51.       cbStruct := sizeof(HHP);
  52.       hInstance := 0;
  53.       idString := 0;
  54.       pszText := PChar(Msg);
  55.       pt.x := 10;
  56.       pt.y := 10;
  57.       Windows.ClientToScreen(Button2.handle, pt);
  58.       clrForeground := -1;
  59.       clrBackground := -1;
  60.       rcMargins.Left := -1;
  61.       rcMargins.Right := -1;
  62.       rcMargins.Top := -1;
  63.       rcMargins.Bottom := -1;
  64.       pszFont := PChar('MS Sans Serif, 10');
  65.    end;
  66.    HH(Button2.handle, '', HH_Display_Text_Popup, longint(@HHP));
  67. end;
  68.  
  69. end.
  70.